package com.wf.smartcomm.server.bean;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

/** 
 * @author 38884306@qq.com  
 * @version ����ʱ�䣺2015-5-18 ����11:26:47 
 * 
 */
@Entity
@Table(name = "t_house")
public class House {
	@Expose
	@Id
	@Column(length = 32)
	private String objectId;
	
	@ManyToOne
	@JoinColumn(name = "uid")
	private User user;
	
	@Expose
	@Column(length = 32)
	private String receiver;
	
	@Expose
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "vid")
	private Village village;
	
	@Expose
	@Column(length = 10)
	private String region;
	
	@Column
	private Integer type;
	
	@Column
	private BigDecimal price;
	
	@Column(length = 20)
	private String emNumber;//电表号
	
	@Column(length = 20)
	private String wmNumber;//水表号
	
	@Expose
	@Column(length = 20)
	private String area;//面积
	
	@Column(length = 1)
	private String isUseAuth;//是否使用权限
	
	@Expose
	@Column(length = 10)
	private String name;//业主姓名
	
	@Expose
	@Column(length = 32)
	private String id;//身份证
	
	@Expose
	@Column(length = 32)
	private String unitPassword;//单元机密码
	
	@Expose
	@Column(length = 20)
	private String phoneNumber;//电话
	
	@Expose
	@Column(length = 10)
	private String building;
	
	@Expose
	@Column(length = 10)
	private String entrance;
	
	@Expose
	@Column(length = 32)
	private String disAddress;
	
	@Column(length = 1)
	private String isAuthoritied;
	
	@Expose
	@Column(length = 20)
	private String number;
	
	@Column(length = 20)
	private String createdAt;
	
	@Column(length = 20)
	private String needPayAt;
	
	@Column(length = 20)
	private String buyAt;
	
	@Column(length = 20)
	private String getAt;
	
	@Expose
	@Column(length = 20)
	private String updateAt;
	
	@Expose
	@Column(length = 20)
	private String notifyDate;
	
	@Expose
	@Column(length = 20)
	private String voipPhoneNumber;
	
	public House(String houseId) {
		this.objectId = houseId;
	}
	
	public House() {
		
	}
	
	public String getNeedPayAt() {
		return needPayAt;
	}

	public void setNeedPayAt(String needPayAt) {
		this.needPayAt = needPayAt;
	}

	public String getNotifyDate() {
		return notifyDate;
	}

	public void setNotifyDate(String notifyDate) {
		this.notifyDate = notifyDate;
	}

	public String getUpdateAt() {
		return updateAt;
	}

	public void setUpdateAt(String updateAt) {
		this.updateAt = updateAt;
	}

	public String getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(String createdAt) {
		this.createdAt = createdAt;
	}

	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	/*public Set<UnitMachine> getuMachines() {
		return uMachines;
	}

	public void setuMachines(Set<UnitMachine> uMachines) {
		this.uMachines = uMachines;
	}*/

	public Village getVillage() {
		return village;
	}

	public void setVillage(Village village) {
		this.village = village;
	}

	public String getBuilding() {
		return building;
	}

	public String getBuyAt() {
		return buyAt;
	}

	public void setBuyAt(String buyAt) {
		this.buyAt = buyAt;
	}

	public String getGetAt() {
		return getAt;
	}

	public void setGetAt(String getAt) {
		this.getAt = getAt;
	}

	public void setBuilding(String building) {
		this.building = building;
	}

	public String getEntrance() {
		return entrance;
	}

	public void setEntrance(String entrance) {
		this.entrance = entrance;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getIsAuthoritied() {
		return isAuthoritied;
	}

	public void setIsAuthoritied(String isAuthoritied) {
		this.isAuthoritied = isAuthoritied;
	}

	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	public String getRegion() {
		return region;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public String getEmNumber() {
		return emNumber;
	}

	public void setEmNumber(String emNumber) {
		this.emNumber = emNumber;
	}

	public String getWmNumber() {
		return wmNumber;
	}

	public void setWmNumber(String wmNumber) {
		this.wmNumber = wmNumber;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getIsUseAuth() {
		return isUseAuth;
	}

	public void setIsUseAuth(String isUseAuth) {
		this.isUseAuth = isUseAuth;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUnitPassword() {
		return unitPassword;
	}

	public void setUnitPassword(String unitPassword) {
		this.unitPassword = unitPassword;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getDisAddress() {
		return disAddress;
	}

	public void setDisAddress(String disAddress) {
		this.disAddress = disAddress;
	}

	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	public void update(House house) {
		region = house.region;
		building = house.building;
		entrance = house.entrance;
		number = house.number;
		name = house.name;
		id = house.id;
	}

	public String getVoipPhoneNumber() {
		return voipPhoneNumber;
	}

	public void setVoipPhoneNumber(String voipPhoneNumber) {
		this.voipPhoneNumber = voipPhoneNumber;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
}
